#include "sort.h"

static int quick_sort(STR_NUM **nums, int left, int right)
{
    int key = left;
    while(left < right){
        while((left < right) && (big_data_cmp(nums[key]->s, nums[right]->s) <= 0)){
            right--;
        }
        while((left < right) && (big_data_cmp(nums[key]->s, nums[left]->s) >= 0)){
            left++;
        }
        swap_big_date(nums, left, right);
    }
    swap_big_date(nums, key, left);
    return left;
}

void quick_process(STR_NUM **nums, int left, int right)
{
    int key;
    if(left >= right){
        return;
    }
    key = quick_sort(nums, left, right);
    quick_process(nums, left, key - 1);
    quick_process(nums, key + 1, right);
}

